package com.qyhl.cloud.webtv.module_integral.taskcenter;


import com.qyhl.webtv.commonlib.entity.intergral.SignBean;
import com.qyhl.webtv.commonlib.entity.intergral.TaskCenterBean;

public class TaskCenterPresenter implements TaskCenterContract.TaskCenterPresenter {
    private TaskCenterActivity mView;
    private TaskCenterModel mModel;

    public TaskCenterPresenter(TaskCenterActivity mView) {
        this.mView = mView;
        this.mModel = new TaskCenterModel(this);
    }

    @Override
    public void getTaskCenterInfo(String username) {
        mModel.getTaskCenterInfo(username);
    }

    @Override
    public void doSign(String username) {
        mModel.doSign(username);
    }

    @Override
    public void getSuccess(TaskCenterBean bean) {
        mView.getSuccess(bean);
    }

    @Override
    public void getError(int code, String msg) {
        switch (code) {
            case 0:
                mView.getNetError(msg);
                break;
            default:
                mView.getError(msg);
                break;
        }
    }

    @Override
    public void doSignSuccess(SignBean bean) {
        mView.doSignSuccess(bean);
    }

    @Override
    public void doSignFailure(int code, String msg) {
        switch (code) {
            case 0:
                mView.getNetError(msg);
                break;
            default:
                mView.doSignFailure(msg);
                break;
        }
    }
}
